//
//  CollectionViewCell.m
//  CollectionViewTest
//
//  Created by dllo on 16/6/12.
//  Copyright © 2016年 doll. All rights reserved.
//

#import "CollectionViewCell.h"
#import "TableViewCell.h"

@implementation CollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatSubViews:frame];
    }
    return self;
}

- (void)creatSubViews:(CGRect)frame{
    UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height) style:1];
    tableView.delegate = self;
    tableView.dataSource = self;
    [self.contentView addSubview:tableView];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *ID= @"cell";
    TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[TableViewCell alloc]initWithStyle:1 reuseIdentifier:ID];
    }
    cell.backgroundColor = COLORAUTO;
    cell.textLabel.text = @"111";
    return cell;
}






@end
